﻿using BlogSystem.Common.Config;
using BlogSystem.Common.Validation;
using BlogSystem.Mediator.Mediator;
using BlogSystem.Service;

namespace BlogSystem.Mediator.Handler;

public class UserLoginNotificationHandler: INotificationHandler<UserLoginNotification>
{

    private readonly IUserService _userService;
    
    private readonly IMediator _mediator; // 用于发送其他命令或查询

    private readonly LoginValidatior _loginValidatior;

    public UserLoginNotificationHandler(IUserService userService,IMediator mediator, LoginValidatior loginValidatior)
    {
        _userService = userService;
        _mediator = mediator;
        _loginValidatior = loginValidatior;
    }
    
    public async Task Handle(UserLoginNotification notification)
    {
        // 处理用户登录通知的逻辑，可以在这里写入日志或触发其他事件
        //可以直接调用服务层的Service
    }
}